package org.leyi.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.leyi.shop.model.bo.OrderDelayItem;
import org.leyi.shop.model.pojo.Order;

/**
* @author lenovo
* description 针对表【order(订单表)】的数据库操作Service
* create 2024-05-04 23:19:17
*/
public interface OrderService extends IService<Order> {

    /**
     * description: 开启线程
     *
     * @author lenovo
     * create 2024/5/7-23:10
     */
     void startConsumeOrderQueueThread();



    /**
     * description: 阻塞线程
     *
     * @author lenovo
     * create 2024/5/7-23:10
     */
     void stopConsumeOrderQueueThread();

    OrderDelayItem removeById(Long orderId);

    /**
     * description: 用户取消订单
     *
     * @param orderId 用户根据订单id去查找redis对应的订单，并删除该订单，存入数据库
     * @return
     * @author lenovo
     * create 2024/5/5-23:52
     */
     OrderDelayItem cancelOrder(Long orderId);

    /**
     * description: 用户主动付款
     *
     * @param orderId 用户根据订单id去查找redis对应的订单，并删除该订单，存入数据库
     * @return
     * @author lenovo
     * create 2024/5/8-21:29
     */
     OrderDelayItem payOrder(Long orderId);

    /**
     *
     * description: 实现增加一个订单
     * @param orderDelayItem
     * @author  lenovo
     * create 2024/5/8-1:20
     */
     OrderDelayItem addOrder(OrderDelayItem orderDelayItem);
}
